<template>
    <div class="knowledgeTransfer knowledge-container">
        <div class="treeContent">
            <div class="header">
                <span>知识类目</span>
            </div>
            <knowledgeTree @getClassId="getClassId" type="class" :canEdit="false"></knowledgeTree>
        </div>
        <div class="container calcwidth">
            <el-tabs v-model="activeName">
                <el-tab-pane label="新增问题" name="addAudit" v-if="menuAuthCodes.includes('M54')"></el-tab-pane>
                <!-- <el-tab-pane label="纠错问题" name="correctAudit" v-if="menuAuthCodes.includes('M55')"></el-tab-pane> -->
            </el-tabs>
            <component :is="activeName" :classId="classId"></component>
        </div>
    </div>
</template>

<script>
import knowledgeTree from "@/components/knowledgeTree";
import addAudit from "./addAudit/index.vue";
import correctAudit from "./correctAudit/index.vue";
import blank from "@/components/Blank";
export default {
    name: "knowledgeTransfer",
    data() {
        return {
            activeName: "",
            classId: "0"
        };
    },
    created() {
        if (this.menuAuthCodes.includes('M54')) {
            this.activeName = "addAudit";
        } else if (this.menuAuthCodes.includes('M55')) {
            this.activeName = "correctAudit";
        } else {
            this.activeName = "blank";
        }
    },
    methods: {
        getClassId(classId) {
            this.classId = classId;
        }
    },
    components: {
        knowledgeTree,
        addAudit,
        correctAudit,
        blank
    },
}
</script>

<style lang="scss">
.knowledgeTransfer {
    height: 100%;
}
</style>